package com.baizhi.controller;




import com.baizhi.entity.DdCategory;
import com.baizhi.service.impl.DdCategoryServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xutengyang
 * @since 2020-12-14
 */
@RestController
public class DdCategoryController {
    @Autowired
    private DdCategoryServiceImpl dsi;

    @GetMapping("categorys/{cid}")
    public List<DdCategory> getCategoryS(@PathVariable("cid")Integer cid){
        QueryWrapper<DdCategory> wrapper = new QueryWrapper<>();
        wrapper.eq("category_type",cid);
        List<DdCategory> list = dsi.list(wrapper);
        return list;
    }
}

